package xyz.xxpc.springcloud.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {
    @Value("${spring.application.name}") // 直接读取配置文件中的值
    private String appName;

    @RequestMapping("/test")
    public String showAppName(){
        return "配置的应用名称为->" + this.appName;
    }
}
